<?php
// +----------------------------------------------------------------------
// | XiaMiCMF - 代码如诗
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2016 http://shujuwajue.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小虾米 <509129@qq.com>
// +----------------------------------------------------------------------
namespace Admin\Model;

use Common\Model\CommonModel;

class FileManagerModel extends CommonModel
{
    /**
     * 自动验证规则
     */
    protected $_validate = array(
        //array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
        array('type_id', 'require', '必须选择文档类型', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
        array('file_name', 'require', '上传文档不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
        array('file_path', 'require', '文件路径不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
    );

    protected $_auto = array(
        //array(完成字段1,完成规则,[完成条件,附加规则]),
        array('create_time','x_get_date',self:: MODEL_INSERT,'function'),
    );
}

?>